<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JWT</title>
    <!--<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>-->
    <script src="jquery-1.8.0.min.js"></script>
    <script src="loadwith.js"></script>
    <script type="text/javascript">
        var ctx = "${pageContext.request.contextPath}";
        function login() {
           load('post',"/sso/jwt/loginjwt",{username : $("#username").val(),password : $("#password").val()},calls);
        }

        function testLocal() {
            load('get',"/sso/jwt/testAll",null,calls);
        }
        function calls(data) {
            if(data.code==200){
                window.localStorage.token=data.token;
            }else{
                alert(data.msg);
            }
        }
    </script>
</head>
<body>
<center>
    <form name="userForm" id="userForm">
    <table>
        <caption>登录测试</caption>
        <tr>
            <td style="text-align: right;padding-right: 5px">登录名:</td>
            <td style="text-align: left;padding-left: 5px"><input name="username" id="username"/></td>
        </tr>
        <tr>
            <td style="text-align: right;padding-right: 5px">密码:</td>
           <td style="text-align: left;padding-left: 5px"><input name="password" id="password" type="password"/></td>
        </tr>
        <tr>
             <td  style="text-align: right;padding-right: 5px" colspan="2">
                 <input type="button" value="登录" onclick="login()"/></td>
        </tr>
    </table>
    </form>
</center>
<input type="button" value="testlocalStorage" onclick="testLocal()">
</body>
</html>